//
//  PersonalViewController.m
//  唧歪
//
//  Created by ZC on 15/7/8.
//  Copyright (c) 2015年 MWJ. All rights reserved.
//

#import "PersonalViewController.h"
#import "ModifyViewController.h"
#import "AppDelegate.h"

@interface PersonalViewController (){
    AppDelegate *app;
}

@end

@implementation PersonalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"个人信息";
    app = (AppDelegate *)[[UIApplication sharedApplication]delegate];
    self.phone.text = app.appPersonArray[0][@"user_phone"];
    self.sexlab.text = app.appPersonArray[0][@"user_sex"];
    self.count.text = app.appPersonArray[0][@"user_count"];
    //头像
    NSString *headportrait = [NSString stringWithFormat:@"%@",app.appPersonArray[0][@"user_headPortrait"]];
    
//    app.Portrait=headportrait;
    
    NSURL *url=[NSURL URLWithString:headportrait];
    self.headPortrait.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:url]];
    self.headPortrait.layer.masksToBounds = YES;
    self.headPortrait.layer.cornerRadius = self.headPortrait.bounds.size.width/2;
    //创建右边菜单按钮
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"修改" style:UIBarButtonItemStylePlain target:self action:@selector(click)];
    self.navigationItem.rightBarButtonItem = item;
}

-(void)click{
    
    ModifyViewController *modify=[self.storyboard instantiateViewControllerWithIdentifier:@"modifyVC"];
    [self.navigationController pushViewController:modify animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
